﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:local="clr-namespace:StoryMaker.Application" 
    xmlns:common="clr-namespace:StoryMaker.Common;assembly=StoryMaker.Common"
	mc:Ignorable="d">
	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="Utilities.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    <local:ShapeStyleSelector x:Key="shapeStyleSelector" />
    <DataTemplate DataType="local:ShapeViewTemplates">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid x:Name="Options" Grid.Column="0" Height="100" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="75"/>
                </Grid.ColumnDefinitions>
                <StackPanel Orientation="Vertical" >
                    <ToggleButton IsChecked="{Binding DefaultFillShapes}" >
                        <ContentControl/>
                    </ToggleButton>
                    <ToggleButton IsChecked="{Binding DefaultFillShapes, Converter={StaticResource ResourceKey=OppositeBoolConverter}}" >
                        <ContentControl/>
                    </ToggleButton>
                </StackPanel>
                <ListView Grid.Column="1" ItemsSource="{Binding AvailableBrushes, Mode=OneWay}" SelectedItem="{Binding DefaultBrush, Mode=TwoWay}" Width="Auto" ItemTemplate="{DynamicResource BrushSelectionTemplate}" ItemsPanel="{DynamicResource FlowPanelTemplate}" SelectionMode="Single" />
            </Grid>
            <ItemsControl ItemContainerStyleSelector="{StaticResource shapeStyleSelector}" ItemsSource="{Binding Shapes}" ItemsPanel="{DynamicResource HorizontalItemTemplate}" ItemTemplate="{DynamicResource TemplateShape}" Grid.Column="1"/>
        </Grid>
    </DataTemplate>
    
</ResourceDictionary>